package uy.com.tsi2G7.superbet.account;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;


@Table(name="ACCOUNTS")
@Entity
public class Account implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id 
	@Column(name="USER",length=255)
	private String user;
	@Column(name="STATE")
	@Enumerated(EnumType.STRING)
	private AccountState state;
	@Column(name="BALANCE")
	private BigDecimal balance;
	
	public Account(){
	}
	
	public Account(String userId){
		state = AccountState.DEACTIVATED;
		user = userId;
		balance=BigDecimal.ZERO;
	}
	
	public AccountState getState() {
		return state;
	}

	public void setState(AccountState state) {
		this.state = state;
	}
	
	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}
	
}
